package com.seuic.hnjiningposapp.hnapps.ui.view.dialog;

import android.content.Context;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.lxj.xpopup.core.BasePopupView;
import com.seuic.hnjiningposapp.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * 读取到的身份信息
 */
public class SureIdInfoPp extends BasePopupView {
    Unbinder bind;
    @BindView(R.id.name)
    TextView name;
    @BindView(R.id.sex)
    TextView sex;
    @BindView(R.id.birth)
    TextView birth;
    @BindView(R.id.adress)
    TextView adress;
    @BindView(R.id.visa)
    TextView visa;
    @BindView(R.id.validtime)
    TextView validtime;
    @BindView(R.id.query_success_btn)
    Button querySuccessBtn;
    @BindView(R.id.nation)
    TextView nation;
    @BindView(R.id.query_success_layout)
    LinearLayout querySuccessLayout;

    sureidinfoCall mSureidinfoCall;

    public SureIdInfoPp(@NonNull Context context, sureidinfoCall sureidinfoCall) {
        super(context);
        mSureidinfoCall = sureidinfoCall;
    }

    @Override
    protected int getPopupLayoutId() {
        return R.layout.sure_idinfo_pplayout;
    }


    public void setNames(String names) {
        this.names = names;
    }

    public void setSexs(String sexs) {
        this.sexs = sexs;
    }

    public void setBirths(String births) {
        this.births = births;
    }

    public void setAdresss(String adresss) {
        this.adresss = adresss;
    }

    public void setVisas(String visas) {
        this.visas = visas;
    }

    public void setValidtimes(String validtimes) {
        this.validtimes = validtimes;
    }

    public void setNations(String nations) {
        this.nations = nations;
    }

    String names;//姓名
    String sexs;//性别
    String births;//出生日期
    String adresss;//地址
    String visas;//签证机关
    String validtimes;//有效期
    String nations;//名族

    @Override
    protected void onCreate() {
        super.onCreate();
        bind = ButterKnife.bind(this);

        name.setText(names);
        sex.setText(sexs);
        birth.setText(births);
        adress.setText(adresss);
        visa.setText(visas);
        validtime.setText(validtimes);
        nation.setText(nations);

    }

    @Override
    protected void onDismiss() {
        super.onDismiss();
        //注解解绑
        if (bind != null && bind != Unbinder.EMPTY) {
            bind.unbind();
        }
        this.bind = null;
    }

    @OnClick(R.id.query_success_btn)
    public void onViewClicked() {
        mSureidinfoCall.dinfoCall();
    }

    public interface sureidinfoCall {
        void dinfoCall();
    }
}
